package cn.edu.gzist.chapter08kafka.config;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class ConsumerKafka {


//    @KafkaListener(topics = {"my-topic","shandong_shengtai"},groupId = "my-group")
//    public void listen(ConsumerRecord<String, String> record) {
//        System.out.println(record.value());
//        System.out.println("++++++++++++++++++ "+record.topic());
//    }
    @KafkaListener(topics = {"test_topic"},groupId = "groud_123")
    public void consume(String message) {
        System.out.println("接收的信息 = "+message);
//        System.out.println("接收的信息 = "+record.value());

    }
}
